/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lector;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 *
 * @author Educacionit
 */
public class Copiador {

    public static void Copiar(VentanaPrincipal v) throws IOException {
        
        File archivo = new File(v.entrada);
        File archOut = new File(v.salida);
        FileReader in = null;
        BufferedReader reader = null;
        FileWriter out = null;
        BufferedWriter writer = null;
        try {
            out = new FileWriter(archOut);
            writer = new BufferedWriter(out);
            in = new FileReader(archivo);
            reader = new BufferedReader(in);
            String info = "";
            while (reader.ready()) {
                info = reader.readLine();
                /* for (int i = 0; i < info.length(); i++) {
                writer.write(info.charAt(i));
                }*/
                writer.write(info);
                writer.newLine();
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            reader.close();
            in.close();
            writer.close();
            out.close();
        }
    }



    public Copiador() {
    }
}
